package cn.interfacehomework04;


public class Warrior implements Fightable {
    public static int MAX=10;
    int blood;// 定义血液值
    int experience;// 定义经验值

    public void win() {
        experience++;
        System.out.println("获胜了，当前经验值为：" + experience);
    }

    public int injure(int x) {
        blood = blood - x;
        System.out.println("受伤了，当前血液值为：" + blood);
        if (blood < MAX) {
            System.out.println("危险，快点退出战斗！");
        }
        return blood;
    }
}


